Release 10.1A: OpenEdge Data Management:
SQL Reference
DECLARE CURSOR
Associates a cursor with a static query or a prepared dynamic query statement. The query or the prepared statement can have references to host variables.
Syntax
cursor_nameA name you assign to the cursor. The name must meet the requirements for an identifier.
query_expression [ ORDER BY clause ] [FOR UPDATE clause ]A complete query expression.
prepared_statement_nameThe name assigned to a prepared SQL statement in an earlier
ExamplesPREPAREstatement.
Notes
- You must declare a cursor before any
OPEN,FETCH, orCLOSEstatement.- The scope of the cursor declaration is the entire source file in which it is declared. The operations on the cursor, such as
OPEN,CLOSE, andFETCHstatements, can occur only within the same compilation unit as the cursor declaration.- The use of a cursor allows the execution of the positioned forms of the
UPDATEandDELETEstatements.- If the
DECLAREstatement corresponds to a static SQL statement with parameter references:
- The
DECLAREstatement must be executed before each execution of anOPENstatement for the same cursor.- The
DECLAREstatement and theOPENstatement that follows must occur within the same transaction within the same task.- If the statement contains parameter references to automatic variables or function arguments, the
DECLAREstatement and the followingOPENstatement for the same cursor must occur within the same C function.Authorization
None
Related statements
PREPARE, OPEN, FETCH, CLOSE SELECT
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |